package com.angenin.springcloud.service.impl;

import com.angenin.springcloud.Dao.PaymentDao;
import com.angenin.springcloud.entities.Payment;
import com.angenin.springcloud.service.PaymentService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 新建操作数据库服务的接口的实现类。
 */
//只要写dao接口就一定要写@Mapper  (必须形成肌肉记忆)
//只要写service实现类就的写@Service  (必须形成肌肉记忆)
@Service
public class PaymentServiceIpml implements PaymentService {

    @Resource  // @Autowired  二者都是自动注入 是spring那边的，@Resource是java自带的
    private PaymentDao paymentDao;

    public  int create(Payment payment){
        return paymentDao.create(payment);
    };
    public Payment getPaymentById(Long id) {
         return paymentDao.getPaymentById(id);
    };

}
